import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '题目名称',
    align:"center",
    dataIndex: 'title'
   },
   {
    title: '题目类型',
    align:"center",
    dataIndex: 'subType_dictText'
   },
   {
    title: '排序',
    align:"center",
    dataIndex: 'sort'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "题目名称",
      field: "title",
      component: 'Input',
      colProps: {span: 6},
 	},
	{
      label: "题目类型",
      field: "subType",
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"sub_type"
      },
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '题目名称',
    field: 'title',
    component: 'Input',
  },
  {
    label: '题目类型',
    field: 'subType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"sub_type"
     },
  },
  {
    label: '排序',
    field: 'sort',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
//子表单数据
export const subAnswerFormSchema: FormSchema[] = [
  {
    label: '正确答案',
    field: 'answer',
    component: 'JSelectMultiple',
    componentProps:{
        dictCode:"serial_no"
     }
  },
  {
    label: '答案解析',
    field: 'analysis',
    component: 'InputTextArea',
  },
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
//子表表格配置
export const subSelectColumns: JVxeColumn[] = [
    {
      title: '序号',
      key: 'serialNo',
      type: JVxeTypes.select,
      options:[],
      dictCode:"serial_no",
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '选项内容',
      key: 'content',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]


/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}